﻿@model IEnumerable<QuanLyCayXanh.Models.Street>

@{
    ViewBag.Title = "Index";
}

<h2>Danh sách đường</h2>

<p>
    @Html.ActionLink("Thêm mới đường", "Create", null, new { @class = "pure-button"})
</p>
<table class="pure-table pure-table-bordered">
    <thead>
        <tr>
            <th>STT</th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th></th>
        </tr>
    </thead>
    
    @{
        int count = 0;

    }
    @foreach (var item in Model)
    {
        count = count + 1;
        string trClass = count % 2 == 1 ? "" : "pure-table-odd";
        <tr class="@trClass">
            <td>@count</td>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                <a class="pure-button" href="@Url.Action("Edit", new { id = item.Id })">
                    <i class="fa fa-edit"></i>
                </a>
                <a class="pure-button detail-link" href="@Url.Action("Details", new { id = item.Id })">
                    <i class="fa fa-angle-down"></i>
                </a>
                <a class="pure-button delete-link" name="@item.Name" href="@Url.Action("Delete", new { id = item.Id })">
                    <i class="fa fa-remove"></i>
                </a>
                @*@Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "detail-link" }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "delete-link", name = item.Name })*@
            </td>
        </tr>
    }

</table>
@Html.Partial("~/Views/Shared/_ActionForm.cshtml")